Add VS Code extension API analysis tools and reports#1461
Open
Add VS Code extension API analysis tools and reports#1461
Conversation
AST-based analysis of the top 12 open-source VS Code extensions (Python, C/C++, Live Server, Prettier, ESLint, GitLens, Code Runner, Material Icon Theme, Path Intellisense, Auto Rename Tag, REST Client, Docker) to determine the minimal vscode API surface and platform capabilities needed to support them. Scripts (scripts/vscode-extension-analysis/): - analyze-vscode-api-ast.ts: TypeScript compiler API (AST) analyzer that tracks vscode API, Node.js builtins, process/env access, shell execution, network/HTTP, and global side effects - analyze-vscode-api.ts: Faster regex-based analyzer (less precise) - analyze-vscode-extensions.sh + generate_minimal_api.py: Bash/Python tools Key findings: - 6 core namespaces (workspace, window, commands, extensions, env, languages) cover all analyzed extensions - 14 essential methods used by 6+ of 12 extensions - path.join is the only API used by literally every extension - 55% of extensions need child_process (spawn/exec) for external tools - process.env/platform/cwd each used by 6/11 extensions Full report: docs/internal/vscode-extension-api-analysis.md https://claude.ai/code/session_01A5155teGEnWd4jT8e3BxVo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive AST-based analysis tools to examine how the top 12 most-installed open-source VS Code extensions use the VS Code extension API. The analysis helps identify the minimal API surface needed to support these extensions and provides gap analysis between VS Code's API and Fresh's plugin API.
Key Changes
Analysis Scripts:
analyze-vscode-api-ast.ts: TypeScript compiler API-based analyzer that precisely extracts vscode API usage, Node.js builtins, environment access, network/IO, and shell execution patterns from extension source codeanalyze-vscode-api.ts: Regex-based analyzer for extracting activation events and contributions from package.json manifestsanalyze-vscode-extensions.sh: Bash orchestration script to clone extensions and run analysesgenerate_minimal_api.py: Python script to synthesize analysis results into minimal API surface recommendationsAnalysis Reports:
Documentation:
docs/internal/vscode-extension-api-analysis.md: Overview of analyzed extensions with API usage statisticsdocs/internal/vscode-vs-fresh-api-gap-analysis.md: Detailed gap analysis comparing VS Code extension API with Fresh's current plugin API capabilitiesConfiguration:
.gitignoreto exclude cloned extension repositories (which are large)Notable Implementation Details
https://claude.ai/code/session_01A5155teGEnWd4jT8e3BxVo